package top.zhongyy.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import top.zhongyy.pojo.Blog;
import top.zhongyy.pojo.Type;
import top.zhongyy.mapper.TypeMapper;
import top.zhongyy.service.BlogService;
import top.zhongyy.service.TypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author Andy
 * @since 2021-03-25
 */
@Service
public class TypeServiceImpl extends ServiceImpl<TypeMapper, Type> implements TypeService {
    
    @Autowired
    private TypeMapper typeMapper;
    
    @Autowired
    private BlogService blogService;
    
    @Override
    public Type getTypeBtName(String name) {
        QueryWrapper<Type> wrapper = new QueryWrapper<>();
        wrapper.eq("name", name);
        return typeMapper.selectOne(wrapper);
    }
    
    @Override
    public List<Type> getAllType() {
        return typeMapper.getAllType();
    }
    
}
